{% extends "base.html" %}

{% block title %}
  Log: {{ place.app }} {{ place.owner }} {{ place.spot }}
{% endblock %}

{% block header %}
  <em>{{ place.app }}</em> app
  {% if place.spot %}
    <em>{{ place.spot }}</em>
    {% if user != place.owner %}
      <em>{{ place.owner }}</em>'s
    {% endif %}
    spot log
  {% else %}
    release log
  {% endif %}
{% endblock %}

{% block content %}
  <p>
    <a href="{% url MainController %}">Home</a>
    <a href="{% url AppController place.app %}"><em>{{ place.app }}</em> app</a>
    <a href=
      {% if place.spot %}
        "{% url OwnerController place.app place.owner %}"
      {% else %}
        "{% url OwnerController place.app user %}"
      {% endif %}
      >
      <em>{{ place.app }}</em> app
      {% if place.spot && user != place.owner %}
        <em>{{ place.owner }}</em>'s
      {% endif %}
      logs
    </a>
  </p>
  <table>
    <thead>
      <tr>
        <th>date</th>
        <th>level</th>
        <th>user</th>
        <th>message</th>
      </tr>
    </thead>
    <tbody>
      {% for record in records %}
        <tr>
          <td>{{ record.date }}</td>
          <td>{{ record.level }}</td>
          <td>{{ record.user }}</td>
          <td>{{ record.message }}</td>
        </tr>
      {% endfor %}
    </tbody>
  </table>
{% endblock %}
